home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dragdrop / commands.frm (.txt) < prev    next >
Visual Basic Form  |  1999-02-11  |  2KB  |  59 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCommands 
  3.    Caption         =   "Commands"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Label lblArguments 
  13.       BorderStyle     =   1  'Fixed Single
  14.       Height          =   2655
  15.       Left            =   120
  16.       TabIndex        =   1
  17.       Top             =   480
  18.       Width           =   4455
  19.    End
  20.    Begin VB.Label Label1 
  21.       Caption         =   "Command line arguments:"
  22.       Height          =   255
  23.       Left            =   120
  24.       TabIndex        =   0
  25.       Top             =   120
  26.       Width           =   1815
  27.    End
  28. Attribute VB_Name = "frmCommands"
  29. Attribute VB_GlobalNameSpace = False
  30. Attribute VB_Creatable = False
  31. Attribute VB_PredeclaredId = True
  32. Attribute VB_Exposed = False
  33. Option Explicit
  34. ' Display the command line arguments.
  35. Private Sub Form_Load()
  36. Dim cmds As String
  37. Dim txt As String
  38. Dim pos As Integer
  39.     cmds = Command$
  40.     Do While Len(cmds) > 0
  41.         pos = InStr(cmds, " ")
  42.         If pos = 0 Then
  43.             txt = txt & cmds
  44.             cmds = ""
  45.         Else
  46.             txt = txt & Left$(cmds, pos - 1) & vbCrLf
  47.             cmds = Mid$(cmds, pos + 1)
  48.         End If
  49.     Loop
  50.     lblArguments.Caption = txt
  51. End Sub
  52. Private Sub Form_Resize()
  53. Dim hgt As Single
  54.     hgt = ScaleHeight - lblArguments.Top
  55.     If hgt < 120 Then hgt = 120
  56.     lblArguments.Move 0, lblArguments.Top, _
  57.         ScaleWidth, hgt
  58. End Sub
  59.